<template>
  <div style="margin-top:20px"> 
    <el-form label-width="100px" :model="form" ref="form">
      <el-row>
        <el-col :span="8">
          <el-form-item
            label="商品名称"
            label-width="200px"
            prop="name"
            ref="name"
          >
            <my-select
              ref="mySelectBusiness"
              url="api/v5/product/getShow"
              @selected="mySelectedProduct"
              :queryName="this.form.name"
              :businessId="this.form.businessId"
            ></my-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import MySelect from "./myselect";
export default {
  name: "search",
  components: {
    MySelect,
  },
  data() {
    return {
      form: {
        name: "",
        businessId: 852,
        productId: "",
      },
    };
  },
  methods: {
    //搜索商品返回值
    mySelectedProduct(obj) {
      this.form.name = obj.label;
      this.form.productId = obj.product_id;
    },
  },
};
</script>

<style>
</style>